package com.yf.mediaserver.jni;


import lombok.extern.slf4j.Slf4j;

@Slf4j
public class H264Library {

    private static final String LIBRARY_NAME = "libh264stego_java";

    static {
        String userDir = System.getProperty("user.dir");
        log.info("用户路径：{}",userDir);

        System.load( String.format("%s/so/%s.so", userDir, LIBRARY_NAME) );

    }

    public static native int alloc_h264stego(int h, int w, int pix_fmt,int color_range, int fps, String wm_path, float factor);

    public static native int add(int i, int j);

    public static native void close_h264stego(int handle);

    public static native int send(int handle, byte[] data, long pts, long dts);
//    public static native int send(int handle, BytePointer data, long pts, long dts);

//    public static native @Cast("uint8_t*") BytePointer receive(int handle);

    public static native  byte[] receive(int handle);

    /**
     *
     * @param dir 日志目录 ./logs
     * @param level 日志等级 0
     * @param interval 刷新间隔秒数 0
     */
    public static native  void initLog(String dir,int level,int interval);
    public static native  void closeLog();

}
